package com.lihao.baselibrary.base;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;

import org.xutils.http.RequestParams;

@SuppressLint("CommitPrefEdits")
public class ColumValue {

	private SharedPreferences sp;
	private SharedPreferences.Editor editor;

	public ColumValue(Context context) {
		sp = context.getSharedPreferences("personal", Context.MODE_PRIVATE);
		editor = sp.edit();
	}

	//是否登录
	public boolean getIsLogin() {

		return sp.getBoolean("islogin", false);
	}
	public void setIsLogin(boolean islogin) {
		editor.putBoolean("islogin", islogin);
		editor.commit();
	}

	//是否第一次打开APP
	public boolean getIsFirst() {

		return sp.getBoolean("isFirst", true);
	}
	public void setIsFirst(boolean isFirst) {
		editor.putBoolean("isFirst", isFirst);
		editor.commit();
	}
	//手机号码
	public void setPhone(String phone){
		editor.putString("phone",phone);
		editor.commit();
	}
	public  String getPhone(){
		return sp.getString("phone","");
	}


	//登录标识
	public void setLogsign(String logsign){
		editor.putString("logsign",logsign);
		editor.commit();
	}
	public  String getLogsign(){
		return sp.getString("logsign","");
	}

	//用户ID
	public void setUserId(String userId){
		editor.putString("userId",userId);
		editor.commit();
	}
	public  String getUserId(){
		return sp.getString("userId","");
	}

	//Token
	public void setToken(String token){
		editor.putString("token",token);
		editor.commit();
	}
	public  String getToken(){
		return sp.getString("token","");
	}
	//JPush
	public void setJPush(String JPush){
		editor.putString("JPush",JPush);
		editor.commit();
	}
	public  String getJPush(){
		return sp.getString("JPush","");
	}

	//头像
	public void setHeadImg(String HeadImg){
		editor.putString("HeadImg",HeadImg);
		editor.commit();
	}
	public  String getHeadImg(){
		return sp.getString("HeadImg","");
	}


	//昵称
	public void setUserName(String UserName){
		editor.putString("UserName",UserName);
		editor.commit();
	}
	public  String getUserNmae(){
		return sp.getString("UserName","");
	}

	//性别
	public void setUserSex(String userSex){
		editor.putString("userSex",userSex);
		editor.commit();
	}
	public  String getUserSex(){
		return sp.getString("userSex","");
	}

	//年龄
	public void setUserAge(String age){
		editor.putString("age",age);
		editor.commit();
	}
	public  String getUserAge(){
		return sp.getString("age","");
	}



	public final static int WIFI=0;
	public final static int NETWORK=1;
	public final static int NO=2;
	//自动播放视频设置
	public void setAutoPlayVideo(int videoStatus){
		editor.putInt("videoStatus",videoStatus);
		editor.commit();
	}
	public  int getAutoPlayVideo(){
		return sp.getInt("videoStatus",0);

	}
	//自动压缩图片上传
	public void setPicQuality(boolean picStatus){
		editor.putBoolean("picStatus",picStatus);
		editor.commit();
	}
	public  boolean getPicQuality(){
		return sp.getBoolean("picStatus",true);

	}


}
